{extend name="template/base" /}
{block name="style"}
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$id}">
        <h3 class="mb-20 text-c">退还押金</h3>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">退款项目：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="check-box" >
                    <input type="checkbox" name="refund_item[]" id="refund_item-0" value="押金" {php}echo in_array("押金",$refund_item)?'checked':'';{/php}>
                    <label for="refund_item-0">押金</label>
                </div>
                <div class="check-box" >
                    <input type="checkbox" name="refund_item[]" id="refund_item-1" value="GPS" {php}echo in_array("GPS",$refund_item)?'checked':'';{/php}>
                    <label for="refund_item-1">GPS</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">退款押金时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text Wdate  " style="width:250px" placeholder="退款押金时间" autocomplete="off" id="refund_time" name="refund_time" value="{$vo.refund_time?date('Y-m-d',$vo.refund_time):''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">退款押金金额：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="退款押金金额" name="refund_money" value="{$vo.refund_money ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">退款方式：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="refund_means" id="refund_means-0" value="微信支付" {eq name="vo.refund_means" value="微信支付" } checked="checked" {/eq}>
                    <label for="refund_means-0">微信支付</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="refund_means" id="refund_means-1" value="支付宝支付" {eq name="vo.refund_means" value="支付宝支付" } checked="checked" {/eq}>
                    <label for="refund_means-1">支付宝支付</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="refund_means" id="refund_means-2" value="现金支付" {eq name="vo.refund_means" value="现金支付" } checked="checked" {/eq}>
                    <label for="refund_means-2">现金支付</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="refund_means" id="refund_means-3" value="银行卡支付" {eq name="vo.refund_means" value="银行卡支付" } checked="checked" {/eq}>
                    <label for="refund_means-3">银行卡支付</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="refund_means" id="refund_means-4" value="运费中支付" {eq name="vo.refund_means" value="运费中支付" } checked="checked" {/eq}>
                    <label for="refund_means-4">运费中支付</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">备注：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea class="textarea mt-5" placeholder="备注" name="remark" value="{$vo.remark ?? ''}" >{$vo.remark}</textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script>
    $(function () {
        var refund_time_val = $('#refund_time').val();
        if(refund_time_val == '' || typeof refund_time_val == undefined || refund_time_val == null){
            var nowdate = new Date();
            var y = nowdate.getFullYear();
            var m = nowdate.getMonth()+1;//获取当前月份的日期
            m = m < 10 ? ('0' + m) : m;
            var d = nowdate.getDate();
            d = d < 10 ? ('0' + d) : d;
            $('#refund_time').val(y+'-'+m+'-'+d)
        }


        var id = $("#driver_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "driver_id"}
        id.val("{$driver_id}").trigger("change");
        {/notempty}
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
